/**
 * @作者 faner
 * @创建时间 2021/1/20 14:57
 */
package com.faner.fast.upms.domain.dto;

import com.faner.fast.validator.EqualField;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

@Setter
@Getter
@EqualField(srcField = "newPassword", dstField = "confirmPassword", message = "{password.equal-field}")
public  class BasicPasswordDTO {
    @ApiModelProperty(value = "新密码")
    @NotBlank(message = "{password.new.not-blank}")
    @Pattern(regexp = "^[A-Za-z0-9_*&$#@]{6,22}$", message = "{password.new.pattern}")
//    @Pattern(regexp = "^(?=.*[0-9].*)(?=.*[A-Z].*)(?=.*[a-z].*)(?=.*[!@#$%^&*?])\\w.{8,20}$",message = "密码长度必须在8~20位之间，包含大小写字母、数字及特殊符号")
    private String newPassword;

    @ApiModelProperty(value = "确认新密码")
    @NotBlank(message = "{password.confirm.not-blank}")
    private String confirmPassword;
}
